package com.xuecheng.learning.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xuecheng.api.learning.model.dto.CourseRecordDTO;
import com.xuecheng.api.media.model.vo.ResourceUrlModel;
import com.xuecheng.learning.entity.CourseRecord;

/**
 * <p>
 * 选课记录 服务类
 * </p>
 *
 * @author itcast
 * @since 2021-05-21
 */
public interface CourseRecordService extends IService<CourseRecord> {

    /**
     * 根据课程发布信息id和用户名称获取课程记录
     *
     * @param coursePubId 课程发布信息id
     * @return 获取课程记录
     */
    CourseRecordDTO getRecordByCoursePubId(Long coursePubId, String userName);

    /**
     * 创建或者修改学习记录
     */
    CourseRecordDTO createOrModifyRecord(CourseRecordDTO courseRecordDTO);

    /**
     * 根据课程发布Id、课程计划Id、媒资信息Id、用户名获得视频播放信息
     * @param coursePubId
     * @param teachplanId
     * @param mediaId
     * @param username
     * @return
     */
    ResourceUrlModel playUrl(Long coursePubId, Long teachplanId, Long mediaId, String username);
}
